import { request, config } from 'utils';
import { stringify } from 'qs';
const {
  api: {
    global: {
      apilogin,
      apilogout,
      apigetmaindevice,
      apifresh,
      apifreshdns
    },
  },
} = config;

/**
 * 登录
 */
export function login(params) {
  return request(apilogin, {
    method: 'POST',
    body: { ...params },
  });
}
/**
 *退出
 */
export function logOut() {
  return request(apilogout);
}


export function getMainDevToken(params) {
  return request(`${apigetmaindevice}?${stringify(params)}`);
}
export function fresh(params) {
  return request(apifresh, {
    method: 'POST',
    body: { ...params },
  });
}

//启用配置
export function startConfig(params) {
  return request(`${apifreshdns}?${stringify(params)}`);
}
